<!DOCTYPE html>
<html lang="en">

<head>
    <title>QSKJ_LOCAL</title>
    <script src="/Public/js/tianditu.api.js"></script>
    <script src="/Public/js/jquery-3.7.1.min.js"></script>
    <link rel="stylesheet" href="/Public/css/1.css">
    <style>
        #mapDiv {
            position: absolute;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            /* min-height: calc(100vh - 50px); */
        }
    </style>
</head>

<body>
    <div id="mapDiv"></div>
    <script>
        // 初始化天地图
        // var map = new T.Map("mapDiv");
        // map.centerAndZoom(new T.LngLat(116.4074, 39.9042), 11);

        // var imageURL =
        //     "http://t0.tianditu.gov.cn/img_w/wmts?" +
        //     "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
        //     "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=68873c0b0fe4dfa4ecedd009b6483e13";
        // var lay = new T.TileLayer(imageURL, { minZoom: 1, maxZoom: 19 });
        // map.addLayer(lay);

        // var imglayer = new T.TileLayer({
        //     url: "http://t{s}.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=5174fc271848db77b921f28bb7ce5e22"
        // })
        // map.addLayer(imglayer)

        // const imageURL = "http://t0.tianditu.gov.cn/img_w/wmts?" +
        //     "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
        //     "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}" +
        //     "&tk=68873c0b0fe4dfa4ecedd009b6483e13";

        // const imageURLT = "http://t0.tianditu.gov.cn/cia_w/wmts?" +
        //     "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
        //     "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}" +
        //     "&tk=68873c0b0fe4dfa4ecedd009b6483e13";

        const imageURL = "http://t0.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=5174fc271848db77b921f28bb7ce5e22"
        const imageURLT = "http://t0.tianditu.com/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk=5174fc271848db77b921f28bb7ce5e22";
        const lay = new T.TileLayer(imageURL, { minZoom: 6, maxZoom: 18 });
        const lay2 = new T.TileLayer(imageURLT, { minZoom: 6, maxZoom: 18 });
        const config = { layers: [lay, lay2] };
        var map = new T.Map('mapDiv', config);
        map.centerAndZoom(new T.LngLat(110.15114, 22.6281), 11);


    </script>
</body>

</html>